<template>
  <div class="container">
    <el-dialog
      title="退货单详情"
      :visible.sync="particularsDialogs.centerDialogVisible"
      @open="getData"
      @close="confirm"
      center
      :width="widths ? '50%' : '100%'"
    >
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        empty-text="暂无数据"
      >
        <el-table-column
          prop="productname"
          label="商品名称"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="productcode"
          label="商品编码"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="unit"
          label="单位"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="boxspec"
          label="箱规格"
          align="center"
        ></el-table-column>

        <el-table-column
          prop="boxqty"
          label="箱数"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="qty"
          label="数量"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="cost"
          label="成本价"
          align="center"
        ></el-table-column>

        <el-table-column
          prop="price"
          label="退货价"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="inp_price"
          label="入库价"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="spillfoldvalue"
          label="溢折"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="allocateprice"
          label="调货提成"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="profitvalue"
          label="预提"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="packagingboxprofitvalue"
          label="筐提成"
          align="center"
        ></el-table-column>

        <el-table-column
          prop="supplier_name"
          label="供应商"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="supplier_code"
          label="供应商编码"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="buyer"
          label="采购员"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="buyer_code"
          label="采购员编码"
          align="center"
        ></el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { details } from "@/api/middleorder/middleorderlist";
import { parseTime, getnowDate } from "@/utils/index";
export default {
  props: {
    particularsDialogs: Object,
  },
  data() {
    return {
      tableData: [],
      center: [],
      widths: true,
    };
  },
  created() {
    this.phones();
  },
  methods: {
    //判断是否移动端
    phones() {
      let widthScreen = window.screen.width;
      if (widthScreen > 768) {
        this.widths = true;
      } else {
        this.widths = false;
      }
    },
    //关闭
    confirm() {
      this.particularsDialogs.centerDialogVisible = false;
    },
    // 获取数据
    getData() {
      this.tableData = [];
      this.center = [];
      let data = {
        id: this.particularsDialogs.id,
      };
      details(data).then((res) => {
        if (res.code == 0) {
          this.tableData = res.data.son;
        }
      });
    },
  },
};
</script>
<style scoped>
.pagination {
  text-align: right;
  padding: 10px;
}
</style>